<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<script type="text/javascript">
jQuery(document).ready(
  function(){
    jQuery("#adminForm").validate({
      rules:  {
        firstname: "required",
        lastname: "required",
        date_of_birth: {
          required: true,
          date: true
        },
        height: "required",
        weight: "required",
      }
    });
  }
);
</script>
  <fieldset class="adminform">
    <legend>Details</legend>
      <? 
        $id        = null;
        $firstname     = null;
        $lastname      = null;
        $date_of_birth   = null;
        $height     = null;
        $weight     = null;
        $phone_number   = null;
        $published      = true;
        
        if(isset($this->person)){
          $id        = $this->person->id;
          $firstname     = $this->person->firstname;
          $lastname      = $this->person->lastname;
          $date_of_birth  = strftime('%Y-%m-%d', strtotime($this->person->date_of_birth));
          $height     = $this->person->height;
          $weight     = $this->person->weight;
          $phone_number   = $this->person->phone_number;
          $published      = $this->person->published;
        }
        
      ?>
            <table class="admintable">
        <tr>
                    <td class="key">Firstname</td>
          <td>
            <input type="text" name="firstname" id="firstname" value="<?= $firstname ?>" size="40"/>
          </td>
        </tr>
        <tr>
                    <td class="key">Lastname</td>
          <td>
            <input type="text" name="lastname" id="lastname" value="<?= $lastname ?>" size="40"/>
          </td>
        </tr>
        <tr>
          <td class="key">Date of Birth</td>
          <td valign=top>
            <?= JHTML::calendar($date_of_birth, "date_of_birth", "date_of_birth") ?>
          </td>
        </tr>
        <tr>
                    <td class="key">Height</td>
          <td>
            <input type="text" name="height" id="height" value="<?= $height ?>" />
          </td>
        </tr>
        <tr>
                    <td class="key">Weight</td>
          <td>
            <input type="text" name="weight" id="weight" value="<?= $weight ?>" />
          </td>
        </tr>
        <tr>
                    <td class="key">Phone #</td>
          <td>
            <input type="text" name="phone_number" id="phone_number" value="<?= $phone_number ?>" />
          </td>
        </tr>
        <tr>
          <td class="key">Published</td>
          <td>
            <?= JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $published); ?>
          </td>
        </tr>
             </table>
       </fieldset>
       <input type="hidden" name="option" value="<?= JRequest::getVar( 'option' );?>"/>
     <input type="hidden" name="c" value="<?= JRequest::getVar('c', 'season'); ?>" />
       <input type="hidden" name="id" value="<?= $id; ?>"/>
     <input type="hidden" name="task" value=""/>
</form>
